﻿using BJoin.Application.Entity;
using BJoin.MicroSVC.Sample.DataContract.ExtObjects;
using DapperExtensions.Mapper;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace BJoin.MicroSVC.Sample.DataContract.Entities
{

    public partial class FileClassMapper : ClassMapper<FileEntity>
    {
        public FileClassMapper()
        {
            Table("t_file");
            Map(f => f.Id).Key(KeyType.Assigned);
            Map(f => f.Crt).ReadOnly();
            Map(f => f.Upt).ReadOnly();
            Map(f => f.TagIds).Column("tag_ids");
            Map(f => f.TagIdsDecrease).Column("tag_ids");
            Map(f => f.Ext).Column("ext");
            ExMapper();
            base.AutoMap();
        }
        partial void ExMapper();

    }
    /// <summary>
    /// 
    /// </summary>
    public partial class FileEntity:BaseEntity<long,FileExtObject>
    {

        /// <summary>
        /// Descript: 编码
        /// DbType: varchar(50)
        /// AllowNull: NO
        /// Defaultval: 
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// Descript: 名称
        /// DbType: varchar
        /// AllowNull: YES
        /// Defaultval: 
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Descript: 名称
        /// DbType: varchar
        /// AllowNull: YES
        /// Defaultval: 
        /// </summary>

        [Column(TypeName = "array")]
        public int[] TagIds { get; set; }

        /// <summary>
        /// Descript: 创建人
        /// DbType: varchar(20)
        /// AllowNull: YES
        /// Defaultval: 
        /// </summary>
        public string Crb { get; set; }

        /// <summary>
        /// Descript: 创建时间
        /// DbType: timestamp(6)
        /// AllowNull: YES
        /// Defaultval: 
        /// </summary>
        public DateTimeOffset? Crt { get; set; }

        /// <summary>
        /// Descript: 更新人
        /// DbType: _varchar
        /// AllowNull: YES
        /// Defaultval: 
        /// </summary>
        public string Upb { get; set; }

        /// <summary>
        /// Descript: 备注
        /// DbType: text
        /// AllowNull: YES
        /// Defaultval: 
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// Descript: 更新时间
        /// DbType: _time(6)
        /// AllowNull: YES
        /// Defaultval: 
        /// </summary>
        public DateTimeOffset? Upt { get; set; }
    }
}